<div class="row">
<?=$system_message;?>
<div class="alert-box secondary">
	<h5>Applicants</h5>
	<div class="row collapse">
		<div class="large-3 small-3 columns">
			<span class="prefix"><strong>Search Applicants:</strong></span>
		</div>
		<form action="" method="POST">
		<div class="large-6 small-6 columns">
			<input id="student_enrollment_id" class="searchInput" required autocomplete="off" placeholder="To search for applicant, enter name." url="<?=site_url('output/ajax_search_applicants');?>" type="text" name="student_search_data" autofocus>
		</div>
		<div class="large-3 small-3 columns">
			<input type="submit" name="search" class="button postfix" value="Search">
		</div>
		</form>
	</div>
	<div style="margin-top:1px;margin-bottom:1px;" class="pagination  pagination-mini  pagination-centered">
		<ul>
		<?foreach($a_z as $v):?>
			<li><a href="<?=site_url('search/applicants/'.$v);?>"  class="<?=$active==$v?'btn btn-inverse btn-mini':'';?>">
				<strong><?=strtoupper($v);?></strong></a>
			</li>
		<?endforeach;?>
		</ul>
	</div>
	<hr>
	<span class="label label-inverse" style="font:17px bold;display:inline-block;">Current Applicant's Total: <strong>(<?=$total;?>)</strong></span>
	<span class="label" style="font:17px bold;">New Applicants &nbsp;(<span style="font-weight:bold;font-size:17px;" id="counter"><img src="<?=image_url('6.gif');?>"/></span>)</span>
	<a href="<?=current_url();?>" class="btn btn-mini btn-success">Refresh</a>
	<input type="hidden" name="current_enrollee_total" id="current_enrollment_value" url="<?=site_url('output/sa');?>" value="<?=$total;?>">
	<?=$links;?>
</div>
</div>

<div class="row">
	<?if(!empty($students)):?>
		<table class="table table-striped table-hover">
		<thead>
		<tr>
			<th>Applicant Name</th>
			<th>Applying for Grade Level</th>
			<th>Date/Time Inquired</th>
			<th>&nbsp;</th>
		</tr>
		</thead>
		<tbody>
		<?foreach($students as $k => $student):?>
		<tr>
			<td><?=ucwords($student->fullname);?></td>
			<td><?=$student->level_desc;?></td>
			<td><?=$student->date_enrolled;?></td>
			<td>
				<div class="btn-group left">
				<a class="btn dropdown-toggle btn-mini btn-inverse" data-toggle="dropdown" href="#">
					<i class="icon-g-more icon-g-white"></i>
				</a>
				
				<ul class="dropdown-menu pull-right">
					<?=$print_pre_assessment($student->enrollment_id);?>
					<?php if($student->charge_to=='no' || $student->af_paid=='yes'){ ?>
					<?=$print_assessment_or($student->enrollment_id);?>
					<?php }else{ if($print_assessment_or($student->enrollment_id)!=NULL){ echo $applicant_update_payment($student->enrollment_id); }} ?>
					<?php 
						if($reserves){
							foreach ($reserves as $reserve) {
								if($student->enrollment_id == $reserve->spr_enrollment_id){
									$print_reservation_or = $reserve->spr_id;
									$spr_enrollment_id = $reserve->spr_enrollment_id;
								}else{
									$print_reservation_or = FALSE;
								}
							}
						}
					?>
					<?php if($print_reservation_or){ ?>
						<?php if($student_reservation_payment($student->enrollment_id)!=NULL){ echo '<li><a href="'.site_url('pdf/print_reservation_or/'.$print_reservation_or.'/'.$spr_enrollment_id).'" target="_blank">Print OR for Reservation Fee</a></li>'; }?>
  					<?php }else{ ?>
  					<?=$student_reservation_payment($student->enrollment_id);?>
  					<?php } ?>
					<?=$applicant_status($student->enrollment_id);?>
					<?=$delete_link($student->enrollment_id,$url);?>
				</ul>

				</div>
			</td>
		</tr>
		<?endforeach;?>
		</tbody>
		</table>
	<?else:?>
		<div class="alert-box">
			<i class="icon-exclamation-sign icon-white"></i> Nothing found!
		</div>
	<?endif;?>
</div>
<script type="text/javascript" src="<?=script_url('custom/enrollment_check');?>"></script>
<script type="text/javascript" src="<?=script_url('custom/fsearch_2');?>"></script>